package net.dntuan.training.spring.mvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.integration.endpoint.EventDrivenConsumer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author tuan.dangnhu
 *
 * $LastChangedRevision: 124 $
 * $LastChangedDate: 2014-10-16 07:55:11 +0000 (Thu, 16 Oct 2014) $
 * $LastChangedBy: dnhutuan@gmail.com $
 */
@Controller
public class ConfigUpdaterController {

  @Autowired
  ApplicationContext appContext;

  @RequestMapping("update-config")
  @ResponseBody
  public String updateConfig() {
    EventDrivenConsumer jmsOut = (EventDrivenConsumer) appContext.getBean("jmsout");
    return "try to update an endpoint";
  }
}
